|
ambient8 2.2.0
|
Functions | |
| void | ambient8_cfg_setup (ambient8_cfg_t *cfg) |
| Config Object Initialization function. | |
| AMBIENT8_RETVAL | ambient8_init (ambient8_t *ctx, ambient8_cfg_t *cfg) |
| Initialization function. | |
| void | ambient8_set_register (ambient8_t *ctx, uint8_t *write_buf, uint8_t n_bytes) |
| Writing to device registers. | |
| void | ambient8_get_register (ambient8_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint8_t n_bytes) |
| Reading register value(s). | |
| void | ambient8_set_constants (ambient8_t *ctx) |
| Setting constants for lux level calculation. | |
| AMBIENT8_RETVAL | ambient8_get_als_data (ambient8_t *ctx, uint16_t *als_data_ch1, uint16_t *als_data_ch0) |
| Reading ALS data. | |
| AMBIENT8_RETVAL | ambient8_get_lux_level (ambient8_t *ctx, float *lux_level, float window_factor, float IR_factor) |
| Calculating lux level. | |
| void ambient8_cfg_setup | ( | ambient8_cfg_t * | cfg | ) |
Config Object Initialization function.
| cfg | Click configuration structure. |
@description This function initializes Click configuration structure to init state.
| AMBIENT8_RETVAL ambient8_get_als_data | ( | ambient8_t * | ctx, |
| uint16_t * | als_data_ch1, | ||
| uint16_t * | als_data_ch0 ) |
Reading ALS data.
| ctx | Click object. |
| als_data_ch1 | ALS channel 1 data. |
| als_data_ch0 | ALS channel 0 data. |
@description This function checks for new data by polling ALS status register.
| AMBIENT8_RETVAL ambient8_get_lux_level | ( | ambient8_t * | ctx, |
| float * | lux_level, | ||
| float | window_factor, | ||
| float | IR_factor ) |
Calculating lux level.
| ctx | Click object. |
| lux_level | Lux level calculated using window factor , IR factor and ALS channel 0 and channel 1 data |
| window_factor | Window factor needs to be derived if window is being used. |
| IR_facotr | IR factor needs to be derived if window is being used. |
@description This function reads and data and performs lux level calculation This function returns 0 and stores lux level value into luxLevel_ if new data is ready and if new data is valid.
| void ambient8_get_register | ( | ambient8_t * | ctx, |
| uint8_t | reg_addr, | ||
| uint8_t * | data_buf, | ||
| uint8_t | n_bytes ) |
Reading register value(s).
| ctx | Click object. |
| reg_addr | Register address. |
| data_buf | Output data buf |
| n_bytes | Number of the bytes to be read |
@description This function reads n_bytes - registers(bytes) from device memory
| AMBIENT8_RETVAL ambient8_init | ( | ambient8_t * | ctx, |
| ambient8_cfg_t * | cfg ) |
Initialization function.
| ctx | Click object. |
| cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this Click.
| void ambient8_set_constants | ( | ambient8_t * | ctx | ) |
Setting constants for lux level calculation.
| ctx | Click object. |
@description This function sets constants (gain and integration time) for lux level calculation.
| void ambient8_set_register | ( | ambient8_t * | ctx, |
| uint8_t * | write_buf, | ||
| uint8_t | n_bytes ) |
Writing to device registers.
| ctx | Click object. |
| write_buf | Buffer for bytes to be written. |
| n_bytes | Number of bytes to be written. |
@description This function writes bytes to n_bytes - registers in device memory